var do_App = sm("do_App");
var do_Page = sm("do_Page");
var nf = sm("do_Notification");
var hashdata = mm("do_HashData");
var do_DataCache = sm("do_DataCache");
var deviceone = require("deviceone");
var communityUrl = require("url/community");
var qqHttp = require("helper/http");
var common = require("common");
var rootview = ui("$");

var httpUrl = communityUrl.url.notice.detail;

var pubUrl = require("url/pub");
var bizzType = require("helper/bizzType");
var openHelper = require("helper/open");

//UI
var alayoutRoot = ui("alayoutRoot");
var aLayoutMain= ui("aLayoutMain");
var headerAout = ui("headerAout");
var listViewDetail = ui("listViewDetail");

var pageNum = 1;//当前页码
var isLastPage = false;//是否最后一页
var isConcern = false;

var addheader = headerAout.add("header", "source://view/reuse/header.ui", 0, 0);
//andriod返回键
do_Page.on("back", function() {
	do_App.closePage();
});
//从open的上层页面返回,刷新数据
do_Page.on("result", function(data){
	if (data.comment_add) {
		loadPage(do_Page.getData().id);
	}
});

var menus=[{"template":0,"do_label_1":"举报"}];
/****************处理页面-头部-begin*****************/
//左上角-返回
var headerLeft = ui(addheader + ".headerLeft");
//右上角-
var headerRight = ui(addheader + ".headerRight");
headerLeft.on("touch", function() {
	do_App.closePage()
});

var header = ui("header");
header.bindData(hashdata);
hashdata.addData({
	"labelTitle" : "详情"
})
header.refreshData();


var id;
//页面装载完成后，开始初始化工作
do_Page.on("loaded", function(){
	//读取当前页面的传入参数
	var data=do_Page.getData();
	id=data.id;
	loadPage();
});
var messageDetailList = mm("do_ListData");
listViewDetail.bindItems(messageDetailList);
function loadPage(){
	var params = {
		id : id
	};
	qqHttp.post(httpUrl, params, function(data) {
		// 去掉遮盖
		listViewDetail.rebound();
		messageDetailList.removeAll();
		data.detailVo.template = 0;//指定模板,加载话题说情
		messageDetailList.addOne(data.detailVo);
		listViewDetail.refreshItems();
	});
	
}
